<!DOCTYPE html>
<html>

<body class="bgf6">
	
	<div class="main-nav">
		<div class="container">
			<ul class="nav-list clearfix">
				<li><a href="">首页</a></li>
			</ul>
		</div>
	</div>
	
	<div class="top-bar">
		<div th:include="common/commonHead :: atmBoHead"></div>
	</div>
	
	<div class="main-body pb100">
		<div class="container pt10">
			<div class="dflx sbt">
				<div class="body-left bgff">
					<div th:include="common/commonLeft :: atmBoLeft"></div>
				</div>
				
				<div id="atmBoApp" class="body-right">
					<div class="bread-nav bgff">
						<ul class="dflx">
							
						</ul>
					</div>
					
					<div class="bgff mt10 pb20 edit-mode">
						<div class="wrap">
							
                            <div class="box">
                            	<div class="box-title"><span>添加用户</span></div>
                            	<div class="mt20 f14">
                            		<div class="two">
                            			<span class="title"><i class="cred">*</i> 用户名</span>
	                					<div class="content">
	                						<input type="text" class="form-control" v-model="username" placeholder="请输入用户名"/>
	                					</div>
	                        			<span class="title">密码</span>
	                					<div class="content">
	                						<input type="text" class="form-control" v-model="password" placeholder="请输入密码"/>
                						</div>
                            		</div>

                            	</div>
                            </div>
                            
                            <div class="tc mt40">
                            	<button type="button" class="btn btn-primary f12" v-on:click="addUser"> 创建 </button>
                            </div>
							
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	

	<script>
		var app = new Vue({
			el : '#atmBoApp',
			data : {
				username : '',
				password : ''
			},
			methods : {
				addUser : function () {
					alert(this.username + '-' + this.password);
					//发送异步请求 jquery
					$.ajax({
						type : 'POST',
						dataType : 'JSON',
						url : '/user/addUser',
						data : {
							username : this.username,
							password : this.password
						},
						success : function (result) {
							if (result.code != 1000){
								alert(result.message);
								return;
							}

							alert('添加成功');
						}
					});
				}
			}
		});

	</script>
</body>
</html>
